import axios from "@/utils/http";
//数据
const state = {
  userData: {
    menuInfo: [
      {
        menuId: 1,
        menuName: "看病就诊",
        menuUrl: "/treat",
        componentName: "treat",
        menuImgClass: "",
        componentView: "Treat/CreateTreat",
        menuChilds: [
          {
            menuId: 6,
            menuName: "新开就诊",
            menuUrl: "/treat/createTreat",
            componentName: "createTreat",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Treat/CreateTreat",
          },
          {
            menuId: 7,
            menuName: "就诊列表",
            menuUrl: "/treat/treatList",
            componentName: "treatList",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Treat/TreatList",
          },
          {
            menuId: 8,
            menuName: "医生排班",
            menuUrl: "/treat/doctorScheduling",
            componentName: "doctorScheduling",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Treat/DoctorScheduling",
          },
          {
            menuId: 9,
            menuName: "门诊挂号",
            menuUrl: "/treat/registerTreat",
            componentName: "registerTreat",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Treat/RegisterTreat",
          },
          {
            menuId: 10,
            menuName: "挂号列表",
            menuUrl: "/treat/registerList",
            componentName: "registerList",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Treat/RegisterList",
          },
          {
            menuId: 11,
            menuName: "患者库",
            menuUrl: "/treat/patientList",
            componentName: "patientList",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Treat/PatientList",
          },
        ],
      },
      {
        menuId: 2,
        menuName: "收费发药",
        menuUrl: "/chargeDispensing",
        componentName: "chargeDispensing",
        menuImgClass: "",
        componentView: "ChargeDispensing/ChargeDispensing",
        menuChilds: [
          {
            menuId: 12,
            menuName: "收费发药",
            menuUrl: "/chargeDispensing/chargeDispensing",
            componentName: "chargeDispensing2",
            menuImgClass: "",
            menuChilds: [],
            componentView: "ChargeDispensing/ChargeDispensing",
          },
        ],
      },
      {
        menuId: 3,
        menuName: "药品进销存",
        menuUrl: "/medicine",
        componentName: "medicine",
        menuImgClass: "",
        componentView: "Medicine/Message",
        menuChilds: [
          {
            menuId: 13,
              menuName: "药品信息维护",
            menuUrl: "/medicine/message",
            componentName: "message",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Medicine/Message",
          },
          {
            menuId: 14,
            menuName: "供应商维护",
            menuUrl: "/medicine/supplier",
            componentName: "supplier",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Medicine/Supplier",
          },
          {
            menuId: 15,
            menuName: "采购入库",
            menuUrl: "/medicine/purchase",
            componentName: "purchase",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Medicine/Purchase",
          },
          {
            menuId: 16,
            menuName: "入库审核",
            menuUrl: "/medicine/process",
            componentName: "process",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Medicine/Process",
          },
          {
            menuId: 17,
            menuName: "库存查询",
            menuUrl: "/medicine/stock",
            componentName: "stock",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Medicine/Stock",
          },
        ],
      },
      {
        menuId: 4,
        menuName: "数据统计",
        menuUrl: "/data",
        componentName: "data",
        menuImgClass: "",
        componentView: "Data/RevAndExp",
        menuChilds: [
          {
            menuId: 18,
            menuName: "诊所收支统计",
            menuUrl: "/data/revAndExp",
            componentName: "revAndExp",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Data/RevAndExp",
          },
          {
            menuId: 19,
            menuName: "药品销售统计",
            menuUrl: "/data/medicineSales",
            componentName: "medicineSales",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Data/MedicineSales",
          },
          {
            menuId: 20,
            menuName: "检查项目统计",
            menuUrl: "/data/checkProject",
            componentName: "checkProject",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Data/CheckProject",
          },
          {
            menuId: 21,
            menuName: "年月报表统计",
            menuUrl: "/data/yearsReport",
            componentName: "yearsReport",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Data/YearsReport",
          },
          {
            menuId: 22,
            menuName: "工作量统计",
            menuUrl: "/data/workload",
            componentName: "workload",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Data/Workload",
          },
        ],
      },
      {
        menuId: 5,
        menuName: "系统设置",
        menuUrl: "/setting",
        componentName: "setting",
        menuImgClass: "",
        componentView: "Setting/Doctor",
        menuChilds: [
          {
            menuId: 23,
            menuName: "医生管理",
            menuUrl: "/setting/doctor",
            componentName: "doctor",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Setting/Doctor",
          },
          {
            menuId: 24,
            menuName: "科室管理",
            menuUrl: "/setting/department",
            componentName: "department",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Setting/Department",
          },
          {
            menuId: 25,
            menuName: "挂号费管理",
            menuUrl: "/setting/register",
            componentName: "register",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Setting/Register",
          },
          {
            menuId: 26,
            menuName: "处方附加费",
            menuUrl: "/setting/prescription",
            componentName: "prescription",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Setting/Prescription",
          },
          {
            menuId: 27,
            menuName: "检查项目费",
            menuUrl: "/setting/checkProject",
            componentName: "checkProject2",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Setting/CheckProject",
          },
          {
            menuId: 28,
            menuName: "字典表维护",
            menuUrl: "/setting/dictionaryTable",
            componentName: "dictionaryTable",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Setting/DictionaryTable",
          },
          {
            menuId: 29,
            menuName: "诊所信息",
            menuUrl: "/setting/clinicMessage",
            componentName: "clinicMessage",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Setting/ClinicMessage",
          },
          {
            menuId: 30,
            menuName: "第三方设置",
            menuUrl: "/setting/thirdParty",
            componentName: "thirdParty",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Setting/ThirdParty",
          },
          {
            menuId: 31,
            menuName: "查看日志",
            menuUrl: "/setting/log",
            componentName: "log",
            menuImgClass: "",
            menuChilds: [],
            componentView: "Setting/Log",
          },
        ],
      },
    ],
    userInfo: { empUserName: "暂无登录" },
    firstMenu:"数据统计"
  },
};

const getters = {
  getUser(state:any){
    
    return state.userData
  }
};

const actions = {};

const mutations = {
  setMenuInfo(state:any){
    
    // axios({
    //   url:"/login/initMenu",
    //   method:"get",
    //   params:{
    //   }
    //   }).then((res:any)=>{
    //       state.userData.menuInfo=res.data.data
          
    //  }).catch(err=>{
    //   console.log(err);
    //  })
    
    
  },

  setUserInfo(state:any){
    // axios({
    //   url:"/login/getCurrentEmp",
    //   method:"get",
    //   params:{
    //   }
    //   }).then((res:any)=>{
    //     state.userData.userInfo=res.data.data
    //  }).catch(err=>{
    //   console.log(err);
    //  })
    
    
  }
};

export default {
  state,
  mutations,
  actions,
  getters,
};
